#define _CRT_SECURE_NO_WARNINGS 1

#include"binarytree.h"
#include"queue.h"


void test1()
{
	BTNode* n1 = BuyTreeNode(1);
	BTNode* n2 = BuyTreeNode(2);
	BTNode* n3 = BuyTreeNode(3);
	BTNode* n4 = BuyTreeNode(4);
	BTNode* n5 = BuyTreeNode(5);
	BTNode* n6 = BuyTreeNode(6);
	BTNode* n7 = BuyTreeNode(7);

	n1->lchild = n2;
	n1->rchild = n4;
	n2->lchild = n3;
	n4->lchild = n5;
	n4->rchild = n6;
	n2->rchild = n7;

	printf("%d\n", IsTreeComplete(n1));

	//LevelOrder(n1);
	//printf("\n");


	//PreOrder(n1);
	//printf("\n");

	//BTNode* ret = TreeFind(n1, 7);
	//ret->val = 10;
	//PreOrder(n1);
	//printf("\n");


	//printf("%d\n", TreeSize(n1));
	//printf("%d\n", TreeLeafSize(n1));
	//printf("%d\n", TreeHeight(n1));
	//printf("%d\n", TreeNodeLevelK(n1, 1));
	//printf("%d\n", TreeNodeLevelK(n1, 2));
	//printf("%d\n", TreeNodeLevelK(n1, 3));
	//printf("%d\n", TreeNodeLevelK(n1, 4));


	//PreOrder(n1);
	//Inorder(n1);
	//printf("\n");
	//Postorder(n1);
	//printf("\n");
}


void test2()
{
	const char* s = "ABDNNNCENGNNFNN";
	int i = 0;
	BTNode* root = CreateTree(s, &i);
	Inorder(root);

	DestroyTree(root);
}


void test3()
{
}


int main()
{
	test1();

	return 0;
}

